Feat: PUID/PGID support via env variables in Dockerfile#443
Open
tikhonp wants to merge 3 commits intoswingmx:masterfrom
Open
Feat: PUID/PGID support via env variables in Dockerfile#443tikhonp wants to merge 3 commits intoswingmx:masterfrom
tikhonp wants to merge 3 commits intoswingmx:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for configurable user and group IDs (PUID/PGID) via environment variables to resolve permission issues when mounting volumes that are written to by other containers. The implementation includes a new entrypoint script that dynamically adjusts user permissions at container runtime.
Key changes:
- Introduces an entrypoint.sh script that modifies user/group IDs at runtime based on PUID/PGID environment variables
- Updates Dockerfile to install gosu, create a default user, and set up the new entrypoint
- Documents the feature in README.md with default PUID/PGID values of 1000
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| entrypoint.sh | New script that handles runtime user/group ID modification and executes the application as the configured user |
| Dockerfile | Adds user creation, gosu installation, environment variables for PUID/PGID/USER_NAME, and switches to the new entrypoint |
| README.md | Documents the new PUID/PGID environment variables and their default values |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (check at least one)
Other information:
I had permission denied errors on my
/musicfolder because other containers in my infrastructure write data to it. To resolve this issue, I introduced thePUIDandPGIDenvironment variables into the Docker image.